#ifndef _WATCHPOINT_H_
#define _WATCHPOINT_H_

#include "types.h"

#include <cstdio>
#include <set>

#ifdef CONFIG_WATCHPOINT

class WatchPoint {
private:
    std::set<word_t> points;
public:
    void add(word_t wp) {
        points.insert(wp);
    }
    void del(word_t wp) {
        points.erase(wp);
    }
    bool has(word_t wp) {
        return points.find(wp) != points.end();
    }
    void list() {
        std::printf("WatchPoints:\n");
        for (auto wp : points) {
            std::printf("\t0x%016lx\n", wp);
        }
    }
    void clear() {
        points.clear();
    }
};
#endif

#endif
